{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 网页抓取（Web Scraping）《the President’s lies》全文，仅需 16 行代码\n",
    "\n",
    "整理者：曹鑫 （[CDA.cn](http://cda.cn) 联合创始人）\n",
    "\n",
    "项目地址：[《普通人也可以学 Python》](https://github.com/imcda/Python-Tutorial-for-Humans)\n",
    "\n",
    "## 第 1 部分\n",
    "\n",
    "- 什么是网页抓取？\n",
    "- 查看要抓取的文章，如 [《Trump’s Lies》](https://www.nytimes.com/interactive/2017/06/23/opinion/trumps-lies.html)\n",
    "- 检查网页源代码\n",
    "- 获取到的讯息：\n",
    "    - HTML 代码由标签（tags）组成\n",
    "    - 标签有很多的属性（attributes）\n",
    "    - 标签可以进行多层嵌套（nested）\n",
    "\n",
    "## 第 2 部分\n",
    "\n",
    "- 用 Python 读取网页\n",
    "- 通过 Beautiful Soup 分析网页源代码\n",
    "- 收集所有记录\n",
    "\n",
    "## 第 3 部分\n",
    "\n",
    "- 提取日期\n",
    "- 提取`谎言（Lie）`的内容\n",
    "- 提取`解释（Explanation）`的内容\n",
    "- 提取`URL`网站地址\n",
    "- 回顾探究 Beautiful Soup 方法及其属性\n",
    "- 创建数据集（dataset）\n",
    "\n",
    "## 第 4 部分\n",
    "\n",
    "- 应用表格数据结构\n",
    "- 导出数据集到 CSV 文件\n",
    "- 总结：16行 Python 代码\n",
    "- 附录1：网页爬虫的建议\n",
    "- 附录2：网页抓取的资源\n",
    "- 附录3：Beautiful Soup 的另类语法"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第一部分\n",
    "\n",
    "## 什么是网页抓取？\n",
    "\n",
    "\n",
    "\n",
    "## 查看要抓取的文章\n",
    "\n",
    "让我们一起打开网页[《Trump’s Lies》](https://www.nytimes.com/interactive/2017/06/23/opinion/trumps-lies.html)来查看。\n",
    "\n",
    "## 检查网页源代码（HTML）\n",
    "\n",
    "`Hello <strong><em>CDA</em> students</strong>`\n",
    "\n",
    "Hello <strong><em>CDA</em> students</strong>\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第二部分\n",
    "## 用 Python 读取网页\n",
    "\n",
    "`pip install requests`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "r = requests.get('https://www.nytimes.com/interactive/2017/06/23/opinion/trumps-lies.html')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<built-in method sort of list object at 0x11cd46fa0>\n"
     ]
    }
   ],
   "source": [
    "a_list = ['1','2','100','5','20']\n",
    "\n",
    "\n",
    "print(a_list.sort)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<!--[if (gt IE 9)|!(IE)]> <!--><html lang=\"en\" class=\"no-js page-interactive section-opinion page-theme-standard tone-opinion page-interactive-default limit-small layout-xlarge app-interactive\" itemid=\"https://www.nytimes.com/interactive/2017/06/23/opinion/trumps-lies.html\" itemtype=\"http://schema.org/NewsArticle\" itemscope xmlns:og=\"http://opengraphprotocol.org/schema/\"><!--<![endif]-->\n",
      "<!--[if IE 9]> <html lang=\"en\" class=\"no-js ie9 lt-ie10 page-interactive section-opinion page\n"
     ]
    }
   ],
   "source": [
    "# 打印出网页源代码的前 500 个字符\n",
    "print(r.text[0:500])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 用 Beautiful Soup 来解析 HTML\n",
    "`pip install beautifulsoup4`\n",
    "\n",
    "**注意：** 这里安装的小写和下方导入的写法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bs4 import BeautifulSoup\n",
    "soup = BeautifulSoup(r.text, 'html.parser')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 收集所有的记录\n",
    "\n",
    "观察代码，你可以使用浏览器里面的`检查元素`，你可以复制代码到编辑器，比如`Sublime Text`，做一个样式美化，你就能看得更清楚了。\n",
    "\n",
    "```\n",
    "<span class=\"short-desc\">\n",
    "    <strong>\n",
    "        日期（DATE）\n",
    "    </strong>\n",
    "        谎言（LIE）\n",
    "    <span class=\"short-truth\">\n",
    "        <a href=\"链接（URL）\" target=\"_blank\">\n",
    "        解释（EXPLANATION）\n",
    "        </a>\n",
    "    </span>\n",
    "</span>\n",
    "```\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "results = soup.find_all('span', attrs={'class':'short-desc'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "180"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(results)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<span class=\"short-desc\"><strong>Jan. 21 </strong>“I wasn't a fan of Iraq. I didn't want to go into Iraq.” <span class=\"short-truth\"><a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 21 </strong>“A reporter for Time magazine — and I have been on their cover 14 or 15 times. I think we have the all-time record in the history of Time magazine.” <span class=\"short-truth\"><a href=\"http://nation.time.com/2013/11/06/10-things-you-didnt-know-about-time/\" target=\"_blank\">(Trump was on the cover 11 times and Nixon appeared 55 times.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 23 </strong>“Between 3 million and 5 million illegal votes caused me to lose the popular vote.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/01/23/us/politics/donald-trump-congress-democrats.html\" target=\"_blank\">(There's no evidence of illegal voting.)</a></span></span>]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results[0:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<span class=\"short-desc\"><strong>Nov. 11 </strong>“I'd rather have him  – you know, work with him on the Ukraine than standing and arguing about whether or not  – because that whole thing was set up by the Democrats.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/12/10/us/politics/trump-and-russia.html\" target=\"_blank\">(There is no evidence that Democrats \"set up\" Russian interference in the election.)</a></span></span>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results[-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第三部分\n",
    "## 提取日期（date）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<span class=\"short-desc\"><strong>Jan. 21 </strong>“I wasn't a fan of Iraq. I didn't want to go into Iraq.” <span class=\"short-truth\"><a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a></span></span>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result = results[0]\n",
    "first_result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<strong>Jan. 21 </strong>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('strong')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Jan. 21\\xa0'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('strong').text"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `\\xa0` 是不间断空白符 `&nbsp`;\n",
    "我们通常所用的空格是 `\\x20` ，是在标准ASCII可见字符 `0x20~0x7e` 范围内。\n",
    "而 `\\xa0` 属于 `latin1 （ISO/IEC_8859-1）`中的扩展字符集字符，代表空白符`nbsp(non-breaking space)`。\n",
    "`latin1` 字符集向下兼容 `ASCII （ 0x20~0x7e ）`。通常我们见到的字符多数是 `latin1` 的，比如在 MySQL 数据库中。\n",
    "\n",
    "### `\\u3000` 是全角的空白符\n",
    "根据 `Unicode` 编码标准及其基本多语言面的定义， `\\u3000` 属于 CJK 字符的 CJK 标点符号区块内，是空白字符之一。它的名字是 `Ideographic Space`，有人译作表意字空格、象形字空格等。顾名思义，就是全角的 `CJK` 空格。它跟 `nbsp` 不一样，是可以被换行间断的。常用于制造缩进， `wiki` 还说用于抬头，但没见过。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "str"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(first_result.find('strong').text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Jan. 21'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('strong').text[0:-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Jan. 21, 2017'"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('strong').text[0:-1] + ', 2017'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 提出谎言（lie）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<span class=\"short-desc\"><strong>Jan. 21 </strong>“I wasn't a fan of Iraq. I didn't want to go into Iraq.” <span class=\"short-truth\"><a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a></span></span>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<strong>Jan. 21 </strong>,\n",
       " \"“I wasn't a fan of Iraq. I didn't want to go into Iraq.” \",\n",
       " <span class=\"short-truth\"><a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a></span>]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.contents"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"“I wasn't a fan of Iraq. I didn't want to go into Iraq.” \""
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.contents[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "bs4.element.NavigableString"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(first_result.contents[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"I wasn't a fan of Iraq. I didn't want to go into Iraq.\""
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.contents[1][1:-2]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 提取解释（explanation）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<span class=\"short-truth\"><a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a></span>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.contents[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'(He was for an invasion before he was against it.)'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('a').text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'He was for an invasion before he was against it.'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('a').text[1:-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 提取链接（URL）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_result.find('a')['href']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 回顾探究一下 Beautiful Soup 的方法和属性\n",
    "\n",
    "你可以用以下这两个方法来处理最开始的 soup 对象或者是 Tag 对象：\n",
    "\n",
    "+ `find()`：搜索第一个符合要求的标签，并返回一个 Tag 对象\n",
    "+ `find_all()`：搜索所有符合要求的标签，并返回一个结果集合对象，你可以把它当作是一个 Tag 对象的列表\n",
    "\n",
    "你可以使用以下两个属性来提取 Tag 对象中的信息：\n",
    "\n",
    "+ `text`：提取 Tag 中的文本信息，并返回一个字符串\n",
    "+ `contents`：提取 Tag 对象中的子对象，返回一个 Tag 对象和字符串的列表\n",
    "\n",
    "## 创建数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "records = []\n",
    "for result in results:\n",
    "    date = result.find('strong').text[0:-1] + ', 2017'\n",
    "    lie = result.contents[1][1:-2]\n",
    "    explanation = result.find('a').text[1:-1]\n",
    "    url = result.find('a')['href']\n",
    "    records.append((date, lie, explanation, url))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "180"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(records)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Jan. 21, 2017',\n",
       "  \"I wasn't a fan of Iraq. I didn't want to go into Iraq.\",\n",
       "  'He was for an invasion before he was against it.',\n",
       "  'https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the'),\n",
       " ('Jan. 21, 2017',\n",
       "  'A reporter for Time magazine — and I have been on their cover 14 or 15 times. I think we have the all-time record in the history of Time magazine.',\n",
       "  'Trump was on the cover 11 times and Nixon appeared 55 times.',\n",
       "  'http://nation.time.com/2013/11/06/10-things-you-didnt-know-about-time/'),\n",
       " ('Jan. 23, 2017',\n",
       "  'Between 3 million and 5 million illegal votes caused me to lose the popular vote.',\n",
       "  \"There's no evidence of illegal voting.\",\n",
       "  'https://www.nytimes.com/2017/01/23/us/politics/donald-trump-congress-democrats.html')]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "records[0:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第四部分\n",
    "## 应用表格数据结构"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df = pd.DataFrame(records, columns=['date', 'lie', 'explanation', 'url'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>lie</th>\n",
       "      <th>explanation</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Jan. 21, 2017</td>\n",
       "      <td>I wasn't a fan of Iraq. I didn't want to go in...</td>\n",
       "      <td>He was for an invasion before he was against it.</td>\n",
       "      <td>https://www.buzzfeed.com/andrewkaczynski/in-20...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Jan. 21, 2017</td>\n",
       "      <td>A reporter for Time magazine — and I have been...</td>\n",
       "      <td>Trump was on the cover 11 times and Nixon appe...</td>\n",
       "      <td>http://nation.time.com/2013/11/06/10-things-yo...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Jan. 23, 2017</td>\n",
       "      <td>Between 3 million and 5 million illegal votes ...</td>\n",
       "      <td>There's no evidence of illegal voting.</td>\n",
       "      <td>https://www.nytimes.com/2017/01/23/us/politics...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Jan. 25, 2017</td>\n",
       "      <td>Now, the audience was the biggest ever. But th...</td>\n",
       "      <td>Official aerial photos show Obama's 2009 inaug...</td>\n",
       "      <td>https://www.nytimes.com/2017/01/21/us/politics...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Jan. 25, 2017</td>\n",
       "      <td>Take a look at the Pew reports (which show vot...</td>\n",
       "      <td>The report never mentioned voter fraud.</td>\n",
       "      <td>https://www.nytimes.com/2017/01/24/us/politics...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            date                                                lie  \\\n",
       "0  Jan. 21, 2017  I wasn't a fan of Iraq. I didn't want to go in...   \n",
       "1  Jan. 21, 2017  A reporter for Time magazine — and I have been...   \n",
       "2  Jan. 23, 2017  Between 3 million and 5 million illegal votes ...   \n",
       "3  Jan. 25, 2017  Now, the audience was the biggest ever. But th...   \n",
       "4  Jan. 25, 2017  Take a look at the Pew reports (which show vot...   \n",
       "\n",
       "                                         explanation  \\\n",
       "0   He was for an invasion before he was against it.   \n",
       "1  Trump was on the cover 11 times and Nixon appe...   \n",
       "2             There's no evidence of illegal voting.   \n",
       "3  Official aerial photos show Obama's 2009 inaug...   \n",
       "4            The report never mentioned voter fraud.   \n",
       "\n",
       "                                                 url  \n",
       "0  https://www.buzzfeed.com/andrewkaczynski/in-20...  \n",
       "1  http://nation.time.com/2013/11/06/10-things-yo...  \n",
       "2  https://www.nytimes.com/2017/01/23/us/politics...  \n",
       "3  https://www.nytimes.com/2017/01/21/us/politics...  \n",
       "4  https://www.nytimes.com/2017/01/24/us/politics...  "
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>lie</th>\n",
       "      <th>explanation</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>Oct. 25, 2017</td>\n",
       "      <td>We have trade deficits with almost everybody.</td>\n",
       "      <td>We have trade surpluses with more than 100 cou...</td>\n",
       "      <td>https://www.bea.gov/newsreleases/international...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>Oct. 27, 2017</td>\n",
       "      <td>Wacky &amp; totally unhinged Tom Steyer, who has b...</td>\n",
       "      <td>Steyer has financially supported many winning ...</td>\n",
       "      <td>https://www.opensecrets.org/donor-lookup/resul...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>Nov. 1, 2017</td>\n",
       "      <td>Again, we're the highest-taxed nation, just ab...</td>\n",
       "      <td>We're not.</td>\n",
       "      <td>http://www.politifact.com/truth-o-meter/statem...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>Nov. 7, 2017</td>\n",
       "      <td>When you look at the city with the strongest g...</td>\n",
       "      <td>Several other cities, including New York and L...</td>\n",
       "      <td>http://www.politifact.com/truth-o-meter/statem...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>Nov. 11, 2017</td>\n",
       "      <td>I'd rather have him  – you know, work with him...</td>\n",
       "      <td>There is no evidence that Democrats \"set up\" R...</td>\n",
       "      <td>https://www.nytimes.com/interactive/2017/12/10...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              date                                                lie  \\\n",
       "175  Oct. 25, 2017      We have trade deficits with almost everybody.   \n",
       "176  Oct. 27, 2017  Wacky & totally unhinged Tom Steyer, who has b...   \n",
       "177   Nov. 1, 2017  Again, we're the highest-taxed nation, just ab...   \n",
       "178   Nov. 7, 2017  When you look at the city with the strongest g...   \n",
       "179  Nov. 11, 2017  I'd rather have him  – you know, work with him...   \n",
       "\n",
       "                                           explanation  \\\n",
       "175  We have trade surpluses with more than 100 cou...   \n",
       "176  Steyer has financially supported many winning ...   \n",
       "177                                         We're not.   \n",
       "178  Several other cities, including New York and L...   \n",
       "179  There is no evidence that Democrats \"set up\" R...   \n",
       "\n",
       "                                                   url  \n",
       "175  https://www.bea.gov/newsreleases/international...  \n",
       "176  https://www.opensecrets.org/donor-lookup/resul...  \n",
       "177  http://www.politifact.com/truth-o-meter/statem...  \n",
       "178  http://www.politifact.com/truth-o-meter/statem...  \n",
       "179  https://www.nytimes.com/interactive/2017/12/10...  "
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['date'] = pd.to_datetime(df['date'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>lie</th>\n",
       "      <th>explanation</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2017-01-21</td>\n",
       "      <td>I wasn't a fan of Iraq. I didn't want to go in...</td>\n",
       "      <td>He was for an invasion before he was against it.</td>\n",
       "      <td>https://www.buzzfeed.com/andrewkaczynski/in-20...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2017-01-21</td>\n",
       "      <td>A reporter for Time magazine — and I have been...</td>\n",
       "      <td>Trump was on the cover 11 times and Nixon appe...</td>\n",
       "      <td>http://nation.time.com/2013/11/06/10-things-yo...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2017-01-23</td>\n",
       "      <td>Between 3 million and 5 million illegal votes ...</td>\n",
       "      <td>There's no evidence of illegal voting.</td>\n",
       "      <td>https://www.nytimes.com/2017/01/23/us/politics...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2017-01-25</td>\n",
       "      <td>Now, the audience was the biggest ever. But th...</td>\n",
       "      <td>Official aerial photos show Obama's 2009 inaug...</td>\n",
       "      <td>https://www.nytimes.com/2017/01/21/us/politics...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2017-01-25</td>\n",
       "      <td>Take a look at the Pew reports (which show vot...</td>\n",
       "      <td>The report never mentioned voter fraud.</td>\n",
       "      <td>https://www.nytimes.com/2017/01/24/us/politics...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        date                                                lie  \\\n",
       "0 2017-01-21  I wasn't a fan of Iraq. I didn't want to go in...   \n",
       "1 2017-01-21  A reporter for Time magazine — and I have been...   \n",
       "2 2017-01-23  Between 3 million and 5 million illegal votes ...   \n",
       "3 2017-01-25  Now, the audience was the biggest ever. But th...   \n",
       "4 2017-01-25  Take a look at the Pew reports (which show vot...   \n",
       "\n",
       "                                         explanation  \\\n",
       "0   He was for an invasion before he was against it.   \n",
       "1  Trump was on the cover 11 times and Nixon appe...   \n",
       "2             There's no evidence of illegal voting.   \n",
       "3  Official aerial photos show Obama's 2009 inaug...   \n",
       "4            The report never mentioned voter fraud.   \n",
       "\n",
       "                                                 url  \n",
       "0  https://www.buzzfeed.com/andrewkaczynski/in-20...  \n",
       "1  http://nation.time.com/2013/11/06/10-things-yo...  \n",
       "2  https://www.nytimes.com/2017/01/23/us/politics...  \n",
       "3  https://www.nytimes.com/2017/01/21/us/politics...  \n",
       "4  https://www.nytimes.com/2017/01/24/us/politics...  "
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>lie</th>\n",
       "      <th>explanation</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>2017-10-25</td>\n",
       "      <td>We have trade deficits with almost everybody.</td>\n",
       "      <td>We have trade surpluses with more than 100 cou...</td>\n",
       "      <td>https://www.bea.gov/newsreleases/international...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>2017-10-27</td>\n",
       "      <td>Wacky &amp; totally unhinged Tom Steyer, who has b...</td>\n",
       "      <td>Steyer has financially supported many winning ...</td>\n",
       "      <td>https://www.opensecrets.org/donor-lookup/resul...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>2017-11-01</td>\n",
       "      <td>Again, we're the highest-taxed nation, just ab...</td>\n",
       "      <td>We're not.</td>\n",
       "      <td>http://www.politifact.com/truth-o-meter/statem...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>2017-11-07</td>\n",
       "      <td>When you look at the city with the strongest g...</td>\n",
       "      <td>Several other cities, including New York and L...</td>\n",
       "      <td>http://www.politifact.com/truth-o-meter/statem...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>2017-11-11</td>\n",
       "      <td>I'd rather have him  – you know, work with him...</td>\n",
       "      <td>There is no evidence that Democrats \"set up\" R...</td>\n",
       "      <td>https://www.nytimes.com/interactive/2017/12/10...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          date                                                lie  \\\n",
       "175 2017-10-25      We have trade deficits with almost everybody.   \n",
       "176 2017-10-27  Wacky & totally unhinged Tom Steyer, who has b...   \n",
       "177 2017-11-01  Again, we're the highest-taxed nation, just ab...   \n",
       "178 2017-11-07  When you look at the city with the strongest g...   \n",
       "179 2017-11-11  I'd rather have him  – you know, work with him...   \n",
       "\n",
       "                                           explanation  \\\n",
       "175  We have trade surpluses with more than 100 cou...   \n",
       "176  Steyer has financially supported many winning ...   \n",
       "177                                         We're not.   \n",
       "178  Several other cities, including New York and L...   \n",
       "179  There is no evidence that Democrats \"set up\" R...   \n",
       "\n",
       "                                                   url  \n",
       "175  https://www.bea.gov/newsreleases/international...  \n",
       "176  https://www.opensecrets.org/donor-lookup/resul...  \n",
       "177  http://www.politifact.com/truth-o-meter/statem...  \n",
       "178  http://www.politifact.com/truth-o-meter/statem...  \n",
       "179  https://www.nytimes.com/interactive/2017/12/10...  "
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导出数据集到 CSV 文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_csv('CSVFiles/trump_lies.csv', index=False, encoding='utf-8')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>lie</th>\n",
       "      <th>explanation</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2017-01-21</td>\n",
       "      <td>I wasn't a fan of Iraq. I didn't want to go in...</td>\n",
       "      <td>He was for an invasion before he was against it.</td>\n",
       "      <td>https://www.buzzfeed.com/andrewkaczynski/in-20...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2017-01-21</td>\n",
       "      <td>A reporter for Time magazine — and I have been...</td>\n",
       "      <td>Trump was on the cover 11 times and Nixon appe...</td>\n",
       "      <td>http://nation.time.com/2013/11/06/10-things-yo...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2017-01-23</td>\n",
       "      <td>Between 3 million and 5 million illegal votes ...</td>\n",
       "      <td>There's no evidence of illegal voting.</td>\n",
       "      <td>https://www.nytimes.com/2017/01/23/us/politics...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2017-01-25</td>\n",
       "      <td>Now, the audience was the biggest ever. But th...</td>\n",
       "      <td>Official aerial photos show Obama's 2009 inaug...</td>\n",
       "      <td>https://www.nytimes.com/2017/01/21/us/politics...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2017-01-25</td>\n",
       "      <td>Take a look at the Pew reports (which show vot...</td>\n",
       "      <td>The report never mentioned voter fraud.</td>\n",
       "      <td>https://www.nytimes.com/2017/01/24/us/politics...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>2017-10-25</td>\n",
       "      <td>We have trade deficits with almost everybody.</td>\n",
       "      <td>We have trade surpluses with more than 100 cou...</td>\n",
       "      <td>https://www.bea.gov/newsreleases/international...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>2017-10-27</td>\n",
       "      <td>Wacky &amp; totally unhinged Tom Steyer, who has b...</td>\n",
       "      <td>Steyer has financially supported many winning ...</td>\n",
       "      <td>https://www.opensecrets.org/donor-lookup/resul...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>2017-11-01</td>\n",
       "      <td>Again, we're the highest-taxed nation, just ab...</td>\n",
       "      <td>We're not.</td>\n",
       "      <td>http://www.politifact.com/truth-o-meter/statem...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>2017-11-07</td>\n",
       "      <td>When you look at the city with the strongest g...</td>\n",
       "      <td>Several other cities, including New York and L...</td>\n",
       "      <td>http://www.politifact.com/truth-o-meter/statem...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>2017-11-11</td>\n",
       "      <td>I'd rather have him  – you know, work with him...</td>\n",
       "      <td>There is no evidence that Democrats \"set up\" R...</td>\n",
       "      <td>https://www.nytimes.com/interactive/2017/12/10...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>180 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          date                                                lie  \\\n",
       "0   2017-01-21  I wasn't a fan of Iraq. I didn't want to go in...   \n",
       "1   2017-01-21  A reporter for Time magazine — and I have been...   \n",
       "2   2017-01-23  Between 3 million and 5 million illegal votes ...   \n",
       "3   2017-01-25  Now, the audience was the biggest ever. But th...   \n",
       "4   2017-01-25  Take a look at the Pew reports (which show vot...   \n",
       "..         ...                                                ...   \n",
       "175 2017-10-25      We have trade deficits with almost everybody.   \n",
       "176 2017-10-27  Wacky & totally unhinged Tom Steyer, who has b...   \n",
       "177 2017-11-01  Again, we're the highest-taxed nation, just ab...   \n",
       "178 2017-11-07  When you look at the city with the strongest g...   \n",
       "179 2017-11-11  I'd rather have him  – you know, work with him...   \n",
       "\n",
       "                                           explanation  \\\n",
       "0     He was for an invasion before he was against it.   \n",
       "1    Trump was on the cover 11 times and Nixon appe...   \n",
       "2               There's no evidence of illegal voting.   \n",
       "3    Official aerial photos show Obama's 2009 inaug...   \n",
       "4              The report never mentioned voter fraud.   \n",
       "..                                                 ...   \n",
       "175  We have trade surpluses with more than 100 cou...   \n",
       "176  Steyer has financially supported many winning ...   \n",
       "177                                         We're not.   \n",
       "178  Several other cities, including New York and L...   \n",
       "179  There is no evidence that Democrats \"set up\" R...   \n",
       "\n",
       "                                                   url  \n",
       "0    https://www.buzzfeed.com/andrewkaczynski/in-20...  \n",
       "1    http://nation.time.com/2013/11/06/10-things-yo...  \n",
       "2    https://www.nytimes.com/2017/01/23/us/politics...  \n",
       "3    https://www.nytimes.com/2017/01/21/us/politics...  \n",
       "4    https://www.nytimes.com/2017/01/24/us/politics...  \n",
       "..                                                 ...  \n",
       "175  https://www.bea.gov/newsreleases/international...  \n",
       "176  https://www.opensecrets.org/donor-lookup/resul...  \n",
       "177  http://www.politifact.com/truth-o-meter/statem...  \n",
       "178  http://www.politifact.com/truth-o-meter/statem...  \n",
       "179  https://www.nytimes.com/interactive/2017/12/10...  \n",
       "\n",
       "[180 rows x 4 columns]"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('CSVFiles/trump_lies.csv', parse_dates=['date'], encoding='utf-8')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 180 entries, 0 to 179\n",
      "Data columns (total 4 columns):\n",
      "date           180 non-null datetime64[ns]\n",
      "lie            180 non-null object\n",
      "explanation    180 non-null object\n",
      "url            180 non-null object\n",
      "dtypes: datetime64[ns](1), object(3)\n",
      "memory usage: 5.8+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 总结：16 行 Python 代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "r = requests.get('https://www.nytimes.com/interactive/2017/06/23/opinion/trumps-lies.html')\n",
    "\n",
    "from bs4 import BeautifulSoup\n",
    "soup = BeautifulSoup(r.text, 'html.parser')\n",
    "results = soup.find_all('span', attrs = {'class': 'short-desc'})\n",
    "\n",
    "records = []\n",
    "for result in results:\n",
    "    date = result.find('strong').text[0:-1] + ', 2017'\n",
    "    lie = result.contents[1][1:-2]\n",
    "    explanation = result.find('a').text[1:-1]\n",
    "    url = result.find('a')['href']\n",
    "    records.append((date, lie, explanation, url))\n",
    "    \n",
    "import pandas as pd\n",
    "df = pd.DataFrame(records, columns=['date', 'lie', 'explanation', 'url'])\n",
    "df['date'] = pd.to_datetime(df['date'])\n",
    "df.to_csv('CSVFiles/trump_lies.csv', index=False, encoding='utf-8')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 附录一：注意事项\n",
    "\n",
    "+ 网页抓取适合稳定、架构良好的网页\n",
    "+ 网页抓取是一个「脆弱」的方式创建数据集合\n",
    "+ 如果你能够从一个网站直接下载数据，或者网站提供一个数据的 API 接口，这些都是比网页抓取更好的方式\n",
    "+ 如果你从同一个网站下载过多页面，最好在你的代码中加入一些延迟设计\n",
    "+ 在抓取网页之前，最好查看一下网站的`robots.txt`文件，如`www.nytimes.com/robots.txt`\n",
    "\n",
    "## 附录二：学习资源\n",
    "\n",
    "+ 本案例地址：\n",
    "+ [Beautiful Soup 文档](https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/)，写的像一本教程，值得一读\n",
    "\n",
    "## 附录三：另类语法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<strong>Jan. 21 </strong>"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 通过名字搜索标签内容\n",
    "first_result.find('strong')\n",
    "\n",
    "# 短写法：当作一个属性\n",
    "first_result.strong"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<span class=\"short-desc\"><strong>Jan. 21 </strong>“I wasn't a fan of Iraq. I didn't want to go into Iraq.” <span class=\"short-truth\"><a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 21 </strong>“A reporter for Time magazine — and I have been on their cover 14 or 15 times. I think we have the all-time record in the history of Time magazine.” <span class=\"short-truth\"><a href=\"http://nation.time.com/2013/11/06/10-things-you-didnt-know-about-time/\" target=\"_blank\">(Trump was on the cover 11 times and Nixon appeared 55 times.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 23 </strong>“Between 3 million and 5 million illegal votes caused me to lose the popular vote.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/01/23/us/politics/donald-trump-congress-democrats.html\" target=\"_blank\">(There's no evidence of illegal voting.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 25 </strong>“Now, the audience was the biggest ever. But this crowd was massive. Look how far back it goes. This crowd was massive.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/01/21/us/politics/trump-white-house-briefing-inauguration-crowd-size.html\" target=\"_blank\">(Official aerial photos show Obama's 2009 inauguration was much more heavily attended.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 25 </strong>“Take a look at the Pew reports (which show voter fraud.)” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/01/24/us/politics/unauthorized-immigrant-voting-trump-lie.html\" target=\"_blank\">(The report never mentioned voter fraud.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 25 </strong>“You had millions of people that now aren't insured anymore.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/13/us/politics/fact-check-trump-obamacare-health-care.html\" target=\"_blank\">(The real number is less than 1 million, according to the Urban Institute.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 25 </strong>“So, look, when President Obama was there two weeks ago making a speech, very nice speech. Two people were shot and killed during his speech. You can't have that.” <span class=\"short-truth\"><a href=\"https://www.dnainfo.com/chicago/2017-chicago-murders/timeline?mon=1\" target=\"_blank\">(There were no gun homicide victims in Chicago that day.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 26 </strong>“We've taken in tens of thousands of people. We know nothing about them. They can say they vet them. They didn't vet them. They have no papers. How can you vet somebody when you don't know anything about them and you have no papers? How do you vet them? You can't.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/01/29/us/refugee-vetting-process.html\" target=\"_blank\">(Vetting lasts up to two years.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 26 </strong>“I cut off hundreds of millions of dollars off one particular plane, hundreds of millions of dollars in a short period of time. It wasn't like I spent, like, weeks, hours, less than hours, and many, many hundreds of millions of dollars. And the plane's going to be better.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Most of the cuts were already planned.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 28 </strong>“The coverage about me in the @nytimes and the @washingtonpost has been so false and angry that the Times actually apologized to its dwindling subscribers and readers.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2016/11/13/us/elections/to-our-readers-from-the-publisher-and-executive-editor.html\" target=\"_blank\">(It never apologized.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 29 </strong>“The Cuban-Americans, I got 84 percent of that vote.” <span class=\"short-truth\"><a href=\"http://www.pewresearch.org/fact-tank/2016/11/15/unlike-other-latinos-about-half-of-cuban-voters-in-florida-backed-trump/\" target=\"_blank\">(There is no support for this.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Jan. 30 </strong>“Only 109 people out of 325,000 were detained and held for questioning. Big problems at airports were caused by Delta computer outage.” <span class=\"short-truth\"><a href=\"http://markets.on.nytimes.com/research/stocks/news/press_release.asp?docTag=201701300400PR_NEWS_USPRX____CL99370&amp;feedID=600&amp;press_symbol=7311173\" target=\"_blank\">(At least 746 people were detained and processed, and the Delta outage happened two days later.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 3 </strong>“Professional anarchists, thugs and paid protesters are proving the point of the millions of people who voted to MAKE AMERICA GREAT AGAIN!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/01/28/nyregion/jfk-protests-trump-refugee-ban.html\" target=\"_blank\">(There is no evidence of paid protesters.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 4 </strong>“After being forced to apologize for its bad and inaccurate coverage of me after winning the election, the FAKE NEWS @nytimes is still lost!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2016/11/13/us/elections/to-our-readers-from-the-publisher-and-executive-editor.html\" target=\"_blank\">(It never apologized.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 5 </strong>“We had 109 people out of hundreds of thousands of travelers and all we did was vet those people very, very carefully.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/feb/06/donald-trump/president-trump-says-109-people-were-affected-trav/\" target=\"_blank\">(About 60,000 people were affected.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 6 </strong>“I have already saved more than $700 million when I got involved in the negotiation on the F-35.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the price drop was projected before Trump took office.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 6 </strong>“It's gotten to a point where it is not even being reported. And in many cases, the very, very dishonest press doesn't want to report it.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/02/07/us/politics/the-white-house-list-of-terror-attacks-underreported-by-media.html\" target=\"_blank\">(Terrorism has been reported on, often in detail.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 6 </strong>“The failing @nytimes was forced to apologize to its subscribers for the poor reporting it did on my election win. Now they are worse!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2016/11/13/us/elections/to-our-readers-from-the-publisher-and-executive-editor.html\" target=\"_blank\">(It didn't apologize.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 6 </strong>“And the previous administration allowed it to happen because we shouldn't have been in Iraq, but we shouldn't have gotten out the way we got out. It created a vacuum, ISIS was formed.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2015/11/19/world/middleeast/in-rise-of-isis-no-single-missed-key-but-many-strands-of-blame.html\" target=\"_blank\">(The group’s origins date to 2004.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 7 </strong>“And yet the murder rate in our country is the highest it’s been in 47 years, right? Did you know that? Forty-seven years.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/feb/08/donald-trump/donald-trump-wrong-murder-rate-highest-47-years/\" target=\"_blank\">(It was higher in the 1980s and '90s.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 7 </strong>“I saved more than $600 million. I got involved in negotiation on a fighter jet, the F-35.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(The Defense Department projected this price drop before Trump took office.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 9 </strong>“Chris Cuomo, in his interview with Sen. Blumenthal, never asked him about his long-term lie about his brave ‘service’ in Vietnam. FAKE NEWS!” <span class=\"short-truth\"><a href=\"http://transcripts.cnn.com/TRANSCRIPTS/1702/09/nday.05.html\" target=\"_blank\">(It was part of Cuomo's first question.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 9 </strong>“Sen. Richard Blumenthal now misrepresents what Judge Gorsuch told him?” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/02/10/heres-what-trump-got-wrong-on-twitter-this-week-5/?utm_term=.6fbfc4abc6e0\" target=\"_blank\">(The Gorsuch comments were later corroborated.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 10 </strong>“I don’t know about it. I haven’t seen it. What report is that?” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/02/trump-spins-flynn-facts/\" target=\"_blank\">(Trump knew about Flynn's actions for weeks.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 12 </strong>“Just leaving Florida. Big crowds of enthusiastic supporters lining the road that the FAKE NEWS media refuses to mention. Very dishonest!” <span class=\"short-truth\"><a href=\"http://www.palmbeachpost.com/news/national-govt--politics/trump-heads-back-protesters-supporters-gather/CQXPE9NRk807XKWiDwefWK/\" target=\"_blank\">(The media did cover it.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 16 </strong>“We got 306 because people came out and voted like they've never seen before so that's the way it goes. I guess it was the biggest Electoral College win since Ronald Reagan.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/02/16/us/politics/trump-fact-check.html\" target=\"_blank\">(George H.W. Bush, Bill Clinton and Barack Obama all won bigger margins in the Electoral College.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 16 </strong>“That’s the other thing that was wrong with the travel ban. You had Delta with a massive problem with their computer system at the airports.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/02/03/what-trump-got-wrong-on-twitter-this-week-4/\" target=\"_blank\">(Delta's problems happened two days later.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 16 </strong>“Walmart announced it will create 10,000 jobs in the United States just this year because of our various plans and initiatives.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/business/economy/trump-jobs.html\" target=\"_blank\">(The jobs are a result of its investment plans announced in Oct. 2016.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 16 </strong>“When WikiLeaks, which I had nothing to do with, comes out and happens to give, they’re not giving classified information.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/article/2017/feb/16/fact-checking-donald-trumps-press-conference/\" target=\"_blank\">(Not always. They have released classified information in the past.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 16 </strong>“We had a very smooth rollout of the travel ban. But we had a bad court. Got a bad decision.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/02/16/fact-checking-president-trumps-news-conference/?utm_term=.517d64230dcf\" target=\"_blank\">(The rollout was chaotic.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 16 </strong>“They’re giving stuff — what was said at an office about Hillary cheating on the debates. Which, by the way, nobody mentions. Nobody mentions that Hillary received the questions to the debates.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/article/2017/feb/16/fact-checking-donald-trumps-press-conference/\" target=\"_blank\">(It was widely covered.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 18 </strong>“And there was no way to vet those people. There was no documentation. There was no nothing.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/01/29/us/refugee-vetting-process.html\" target=\"_blank\">(Refugees receive multiple background checks, taking up to two years.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 18 </strong>“You look at what's happening in Germany, you look at what's happening last night in Sweden. Sweden, who would believe this?” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/02/19/world/europe/last-night-in-sweden-trumps-remark-baffles-a-nation.html?rref=collection%2Ftimestopic%2FSweden&amp;action=click&amp;contentCollection=world&amp;region=stream&amp;module=stream_unit&amp;version=latest&amp;contentPlacement=7&amp;pgtype=collection\" target=\"_blank\">(Trump implied there was a terror attack in Sweden, but there was no such attack.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 24 </strong>“By the way, you folks are in here — this place is packed, there are lines that go back six blocks.” <span class=\"short-truth\"><a href=\"http://thehill.com/homenews/administration/320988-trump-falsely-claims-lines-go-back-6-blocks-for-cpac-speech\" target=\"_blank\">(There was no evidence of long lines.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 24 </strong>“ICE came and endorsed me.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/oct/10/donald-trump/trump-says-ice-endorsed-him/\" target=\"_blank\">(Only its union did.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 24 </strong>“Obamacare covers very few people — and remember, deduct from the number all of the people that had great health care that they loved that was taken away from them — it was taken away from them.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/02/24/us/politics/fact-check-trump-blasts-fake-news-and-repeats-inaccurate-claims-at-cpac.html\" target=\"_blank\">(Obamacare increased coverage by a net of about 20 million.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 27 </strong>“Since Obamacare went into effect, nearly half of the insurers are stopped and have stopped from participating in the Obamacare exchanges.” <span class=\"short-truth\"><a href=\"http://www.heritage.org/health-care-reform/report/the-2017-health-insurance-exchanges-major-decrease-competition-and-choice\" target=\"_blank\">(Many fewer pulled out.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 27 </strong>“On one plane, on a small order of one plane, I saved $725 million. And I would say I devoted about, if I added it up, all those calls, probably about an hour. So I think that might be my highest and best use.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the price cut was already projected.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 28 </strong>“And now, based on our very strong and frank discussions, they are beginning to do just that.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/01/us/politics/fact-check-trump-military.html\" target=\"_blank\">(NATO countries agreed to meet defense spending requirements in 2014.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 28 </strong>“The E.P.A.’s regulators were putting people out of jobs by the hundreds of thousands.” <span class=\"short-truth\"><a href=\"http://www.nytimes.com/2011/09/05/business/economy/a-debate-arises-on-job-creation-vs-environmental-regulation.html\" target=\"_blank\">(There's no evidence that the Waters of the United States rule caused severe job losses.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Feb. 28 </strong>“We have begun to drain the swamp of government corruption by imposing a five-year ban on lobbying by executive branch officials.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/politics/2017/live-updates/trump-white-house/real-time-fact-checking-and-analysis-of-trumps-address-to-congress/fact-check-bans-on-lobbying/?utm_term=.ce1370a2b78d\" target=\"_blank\">(They can't lobby their former agency but can still become lobbyists.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 3 </strong>“It is so pathetic that the Dems have still not approved my full Cabinet.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/politics/wp/2017/03/03/trump-is-blaming-the-democrats-for-cabinet-delays-that-are-normal-and-his-own-fault/?utm_term=.68b1395b9ff1\" target=\"_blank\">(Paperwork for the last two candidates was still not submitted to the Senate.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 4 </strong>“Terrible! Just found out that Obama had my ‘wires tapped’ in Trump Tower just before the victory. Nothing found. This is McCarthyism!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/04/us/politics/trump-obama-tap-phones.html\" target=\"_blank\">(There's no evidence of a wiretap.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 4 </strong>“How low has President Obama gone to tap my phones during the very sacred election process. This is Nixon/Watergate. Bad (or sick) guy!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/04/us/politics/trump-obama-tap-phones.html\" target=\"_blank\">(There's no evidence of a wiretap.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 7 </strong>“122 vicious prisoners, released by the Obama Administration from Gitmo, have returned to the battlefield. Just another terrible decision!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/07/us/politics/guantanamo-bay-trump.html\" target=\"_blank\">(113 of them were released by President George W. Bush.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 13 </strong>“I saved a lot of money on those jets, didn't I? Did I do a good job? More than $725 million on them.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the cost cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 13 </strong>“First of all, it covers very few people.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/13/us/politics/fact-check-trump-obamacare-health-care.html\" target=\"_blank\">(About 20 million people gained insurance under Obamacare.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 15 </strong>“On the airplanes, I saved $725 million. Probably took me a half an hour if you added up all of the times.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the cost cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 17 </strong>“I was in Tennessee — I was just telling the folks — and half of the state has no insurance company, and the other half is going to lose the insurance company.” <span class=\"short-truth\"><a href=\"https://public.tableau.com/profile/kaiser.family.foundation#!/vizhome/InsurerParticipationinthe2017IndividualMarketplace/2017InsurerParticipation\" target=\"_blank\">(There's at least one insurer in every Tennessee county.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 20 </strong>“With just one negotiation on one set of airplanes, I saved the taxpayers of our country over $700 million.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the cost cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 21 </strong>“To save taxpayer dollars, I’ve already begun negotiating better contracts for the federal government — saving over $700 million on just one set of airplanes of which there are many sets.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the cost cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 22 </strong>“I make the statement, everyone goes crazy. The next day they have a massive riot, and death, and problems.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/02/19/world/europe/last-night-in-sweden-trumps-remark-baffles-a-nation.html\" target=\"_blank\">(Riots in Sweden broke out two days later and there were no deaths.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 22 </strong>“NATO, obsolete, because it doesn’t cover terrorism. They fixed that.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/sep/27/donald-trump/donald-trump-wrong-again-about-nato-increasing-ter/\" target=\"_blank\">(It has fought terrorism since the 1980s.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 22 </strong>“Well, now, if you take a look at the votes, when I say that, I mean mostly they register wrong — in other words, for the votes, they register incorrectly and/or illegally. And they then vote. You have tremendous numbers of people.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/01/24/us/politics/unauthorized-immigrant-voting-trump-lie.html\" target=\"_blank\">(There's no evidence of widespread voter fraud.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 29 </strong>“Remember when the failing @nytimes apologized to its subscribers, right after the election, because their coverage was so wrong. Now worse!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2016/11/13/us/elections/to-our-readers-from-the-publisher-and-executive-editor.html\" target=\"_blank\">(It didn't apologize.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>March 31 </strong>“We have a lot of plants going up now in Michigan that were never going to be there if I — if I didn’t win this election, those plants would never even think about going back. They were gone.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/business/economy/trump-jobs.html\" target=\"_blank\">(These investments were already planned.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 2 </strong>“And I was totally opposed to the war in the Middle East which I think finally has been proven, people tried very hard to say I wasn’t but you’ve seen that it is now improving.” <span class=\"short-truth\"><a href=\"https://www.buzzfeed.com/andrewkaczynski/in-2002-donald-trump-said-he-supported-invading-iraq-on-the\" target=\"_blank\">(He was for an invasion before he was against it.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 2 </strong>“Now, my last tweet — you know, the one that you are talking about, perhaps — was the one about being, in quotes, wiretapped, meaning surveilled. Guess what, it is turning out to be true.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/04/us/politics/trump-obama-tap-phones.html\" target=\"_blank\">(There is still no evidence.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 5 </strong>“You have many states coming up where they’re going to have no insurance company. O.K.? It’s already happened in Tennessee. It’s happening in Kentucky. Tennessee only has half coverage. Half the state is gone. They left.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/24/us/politics/fact-check-trumps-misleading-claims-in-health-bill-failure.html\" target=\"_blank\">(Every marketplace region in Tennessee had at least one insurer.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 6 </strong>“If you look at the kind of cost-cutting we’ve been able to achieve with the military and at the same time ordering vast amounts of equipment — saved hundreds of millions of dollars on airplanes, and really billions, because if you take that out over a period of years it’s many billions of dollars — I think we’ve had a tremendous success.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the price cuts were already projected.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 11 </strong>“I like Steve, but you have to remember he was not involved in my campaign until very late. I had already beaten all the senators and all the governors, and I didn’t know Steve.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/12/us/politics/trump-steven-bannon-fox-business-news-interview.html?ref=politics\" target=\"_blank\">(He knew Steve Bannon since 2011.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 12 </strong>“You can't do it faster, because they're obstructing. They're obstructionists. So I have people — hundreds of people that we're trying to get through. I mean you have — you see the backlog. We can't get them through.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/12/us/politics/trump-steven-bannon-fox-business-news-interview.html?ref=politics\" target=\"_blank\">(At this point, he had not nominated anyone for hundreds of positions.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 12 </strong>“The New York Times said the word wiretapped in the headline of the first edition. Then they took it out of there fast when they realized.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/23/us/politics/fact-check-trump-misleads-surveillance-wiretapping.html\" target=\"_blank\">(There were separate headlines for print and web, but neither were altered.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 12 </strong>“The secretary general and I had a productive discussion about what more NATO can do in the fight against terrorism. I complained about that a long time ago and they made a change, and now they do fight terrorism.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/12/us/politics/trump-steven-bannon-fox-business-news-interview.html?ref=politics\" target=\"_blank\">(NATO has been engaged in counterterrorism efforts since the 1980s.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 12 </strong>“Mosul was supposed to last for a week and now they’ve been fighting it for many months and so many more people died.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/the-fix/wp/2017/04/12/president-trumps-throughly-confusing-fox-business-interview-annotated/\" target=\"_blank\">(The campaign was expected to take months.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 16 </strong>“Someone should look into who paid for the small organized rallies yesterday. The election is over!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/15/us/politics/tax-day-march.html\" target=\"_blank\">(There's no evidence of paid protesters.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 18 </strong>“The fake media goes, ‘Donald Trump changed his stance on China.’ I haven’t changed my stance.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/14/business/china-currency-manipulation-trump.html\" target=\"_blank\">(He did.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 21 </strong>“On 90 planes I saved $725 million. It's actually a little bit more than that, but it's $725 million.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the price cuts were already projected.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 21 </strong>“When WikiLeaks came out ... never heard of WikiLeaks, never heard of it.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/04/25/fact-checking-president-trumps-pinocchio-laden-associated-press-interview/?utm_term=.33ae871d0c9c\" target=\"_blank\">(He criticized it as early as 2010.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 27 </strong>“I want to help our miners while the Democrats are blocking their healthcare.” <span class=\"short-truth\"><a href=\"http://www.pbs.org/newshour/rundown/retired-coal-miners-get-health-care-fix-pension-problems-remain/\" target=\"_blank\">(The bill to extend health benefits for certain coal miners was introduced by a Democrat and was co-sponsored by mostly Democrats.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 28 </strong>“The trade deficit with Mexico is close to $70 billion, even with Canada it’s $17 billion trade deficit with Canada.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/05/trumps-100-day-boasts/\" target=\"_blank\">(The U.S. had an $8.1 billion trade surplus, not deficit, with Canada in 2016.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 28 </strong>“She's running against someone who's going to raise your taxes to the sky, destroy your health care, and he's for open borders — lots of crime.” <span class=\"short-truth\"><a href=\"http://www.mdjonline.com/opinion/jon-ossoff-voters-too-smart-to-believe-attack-ads/article_d6c9dafa-1e5a-11e7-a93c-c7e0b4d4f985.html\" target=\"_blank\">(Those are not Jon Ossoff's positions.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 28 </strong>“The F-35 fighter jet program — it was way over budget. I’ve saved $725 million plus, just by getting involved in the negotiation.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the price cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 29 </strong>“As you know, I've been a big critic of China, and I've been talking about currency manipulation for a long time. But I have to tell you that during the election, number one, they stopped.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/07/world/asia/fact-check-trump-china-trade.html\" target=\"_blank\">(China stopped years ago.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 29 </strong>“I've already saved more than $725 million on a simple order of F-35 planes. I got involved in the negotiation.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the price cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 29 </strong>“We're also getting NATO countries to finally step up and contribute their fair share. They've begun to increase their contributions by billions of dollars, but we are not going to be satisfied until everyone pays what they owe.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/01/us/politics/fact-check-trump-military.html\" target=\"_blank\">(The deal was struck in 2014.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 29 </strong>“When they talk about currency manipulation, and I did say I would call China, if they were, a currency manipulator, early in my tenure. And then I get there. Number one, they — as soon as I got elected, they stopped.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/07/world/asia/fact-check-trump-china-trade.html\" target=\"_blank\">(China stopped in 2014.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 29 </strong>“I was negotiating to reduce the price of the big fighter jet contract, the F-35, which was totally out of control. I will save billions and billions and billions of dollars.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Most of the cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>April 29 </strong>“I think our side's been proven very strongly. And everybody's talking about it.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/20/us/politics/intelligence-committee-russia-donald-trump.html\" target=\"_blank\">(There's still no evidence Trump's phones were tapped.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 1 </strong>“Well, we are protecting pre-existing conditions. And it'll be every good — bit as good on pre-existing conditions as Obamacare.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/26/upshot/what-changed-in-the-health-repeal-plan-to-win-over-the-freedom-caucus.html\" target=\"_blank\">(The bill weakens protections for people with pre-existing conditions.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 1 </strong>“The F-35 fighter jet — I saved — I got involved in the negotiation. It's 2,500 jets. I negotiated for 90 planes, lot 10. I got $725 million off the price.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the price cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 1 </strong>“First of all, since I started running, they haven't increased their — you know, they have not manipulated their currency. I think that was out of respect to me and the campaign.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/07/world/asia/fact-check-trump-china-trade.html\" target=\"_blank\">(China stopped years ago.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 2 </strong>“I love buying those planes at a reduced price. I have been really — I have cut billions — I have to tell you this, and they can check, right, Martha? I have cut billions and billions of dollars off plane contracts sitting here.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(Much of the cost cuts were planned before Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 4 </strong>“Number two, they’re actually not a currency [manipulator]. You know, since I’ve been talking about currency manipulation with respect to them and other countries, they stopped.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/04/07/world/asia/fact-check-trump-china-trade.html\" target=\"_blank\">(China stopped years ago.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 4 </strong>“We’re the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 4 </strong>“Nobody cares about my tax return except for the reporters.” <span class=\"short-truth\"><a href=\"http://time.com/money/4732925/trump-tax-returns-released-poll/\" target=\"_blank\">(Polls show most Americans do care.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 8 </strong>“You know we’ve gotten billions of dollars more in NATO than we’re getting. All because of me.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/03/01/us/politics/fact-check-trump-military.html\" target=\"_blank\">(The deal was struck in 2014.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 8 </strong>“But when I did his show, which by the way was very highly rated. It was high — highest rating. The highest rating he’s ever had.” <span class=\"short-truth\"><a href=\"http://money.cnn.com/2017/05/11/media/stephen-colbert-trump-no-talent-comment/\" target=\"_blank\">(Colbert's Late Show debut had nearly two million more viewers.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 8 </strong>“Director Clapper reiterated what everybody, including the fake media already knows — there is ‘no evidence’ of collusion w/ Russia and Trump.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/05/10/us/politics/fact-check-fbi-james-comey-sarah-huckabee-sanders.html\" target=\"_blank\">(Clapper only said he wasn't aware of an investigation.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 12 </strong>“Again, the story that there was collusion between the Russians &amp; Trump campaign was fabricated by Dems as an excuse for losing the election.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/05/10/us/politics/fbi-congress-trump-russia-investigations.html\" target=\"_blank\">(The F.B.I. was investigating before the election.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 12 </strong>“When James Clapper himself, and virtually everyone else with knowledge of the witch hunt, says there is no collusion, when does it end?” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/05/10/us/politics/fact-check-fbi-james-comey-sarah-huckabee-sanders.html\" target=\"_blank\">(Clapper said he wouldn't have been told of an investigation into collusion.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 13 </strong>“I'm cutting the price of airplanes with Lockheed.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/\" target=\"_blank\">(The cost cuts were planned before he became president.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>May 26 </strong>“Just arrived in Italy for the G7. Trip has been very successful. We made and saved the USA many billions of dollars and millions of jobs.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/05/26/president-trumps-claim-that-hes-already-saved-millions-of-jobs-on-his-foreign-trip/?utm_term=.820dd5955428\" target=\"_blank\">(He's referencing an arms deal that's not enacted and other apparent deals that weren't announced on the trip.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 1 </strong>“China will be allowed to build hundreds of additional coal plants. So, we can’t build the plants, but they can, according to this agreement. India will be allowed to double its coal production by 2020.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/the-fix/wp/2017/06/01/transcript-president-trumps-remarks-on-leaving-the-paris-climate-deal-annotated/?utm_term=.7f974232c4ba\" target=\"_blank\">(The agreement doesn’t allow or disallow building coal plants.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 1 </strong>“I’ve just returned from a trip overseas where we concluded nearly $350 billion of military and economic development for the United States, creating hundreds of thousands of jobs.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/06/08/the-trump-administrations-tally-of-350-billion-plus-in-deals-with-saudi-arabia/?utm_term=.142db3117855\" target=\"_blank\">(Trump’s figures are inflated and premature.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 4 </strong>“At least 7 dead and 48 wounded in terror attack and Mayor of London says there is ‘no reason to be alarmed!’” <span class=\"short-truth\"><a href=\"http://www.snopes.com/2017/06/04/london-mayor-sadiq-khan-no-reason-to-be-alarmed-trump/\" target=\"_blank\">(The mayor was specifically talking about the enlarged police presence on the streets.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 5 </strong>“The Justice Dept. should have stayed with the original Travel Ban, not the watered down, politically correct version they submitted to S.C.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/06/trumps-tweets-twist-facts/\" target=\"_blank\">(Trump signed this version of the travel ban, not the Justice Department.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 20 </strong>“Well, the Special Elections are over and those that want to MAKE AMERICA GREAT AGAIN are 5 and O!” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/the-fix/wp/2017/06/21/republicans-claim-a-big-victory-and-trump-promptly-exaggerates-it/?utm_term=.ce22a6dade36\" target=\"_blank\">(Republicans have won four special elections this year, while a Democrat won one.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“They all say it's 'nonbinding.' Like hell it's nonbinding.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/06/21/us/politics/trump-iowa-rally-venting-session.html\" target=\"_blank\">(The Paris climate agreement is nonbinding — and Trump said so in his speech announcing the withdrawal.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“Right now, we are one of the highest-taxed nations in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/article/2017/jun/22/fact-checking-nine-things-trump-overstated-got-wro/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“You have a gang called MS-13. ... We are moving them out of the country by the thousands, by the thousands.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/06/factchecking-trumps-iowa-rally\" target=\"_blank\">(The real number of gang members deported is smaller.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“Your insurance companies have all fled the state of Iowa.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/06/factchecking-trumps-iowa-rally/\" target=\"_blank\">(They haven't.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“If [farmers] have a puddle in the middle of their field ... it's considered a lake and you can't touch it. ... We got rid of that one, too, O.K.?” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/06/22/us/politics/factcheck-donald-trump-iowa-rally.html\" target=\"_blank\">(The Obama environmental rule to limit pollution in the country’s waters explicitly excludes puddles.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“Gary Cohn just paid $200 million in tax in order to take this job, by the way.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/06/22/us/politics/factcheck-donald-trump-iowa-rally.html\" target=\"_blank\">(Cohn sold Goldman Sachs stock worth $220 million.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“We’re 5 and 0.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/graphics/politics/trump-claims-database/?utm_term=.60ce71155f60\" target=\"_blank\">(Republicans have won four special elections this year, while a Democrat won one.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 21 </strong>“Last week a brand-new coal mine just opened in the state of Pennsylvania, first time in decades, decades.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/graphics/politics/trump-claims-database/?utm_term=.60ce71155f60\" target=\"_blank\">(Another coal mine opened in 2014.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 22 </strong>“Former Homeland Security Advisor Jeh Johnson is latest top intelligence official to state there was no grand scheme between Trump &amp; Russia.” <span class=\"short-truth\"><a href=\"http://talkingpointsmemo.com/livewire/trump-claims-johnson-testimony-clears-him\" target=\"_blank\">(Johnson, who had a different title, didn't say that.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 23 </strong>“We are 5 and 0 ... in these special elections.” <span class=\"short-truth\"><a href=\"http://www.chicagotribune.com/news/nationworld/politics/factcheck/ct-fact-check-trump-missions-20170624-story.html\" target=\"_blank\">(Republicans have won four special elections this year, while a Democrat won one.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 27 </strong>“Ratings way down!” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/jul/03/donald-trump/trumps-pants-fire-claim-cnn-ratings-are-way-down/\" target=\"_blank\">(CNN's ratings were at a five-year high at the time.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 28 </strong>“Democrats purposely misstated Medicaid under new Senate bill — actually goes up.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/06/30/president-trumps-claim-medicaid-spending-in-senate-health-bill-actually-goes-up/?utm_term=.a319dee54870\" target=\"_blank\">(Senate bill would have cut the program deeply.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>June 29 </strong>“General Kelly and his whole group — they’ve gotten rid of 6,000 so far.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/graphics/politics/trump-claims-database/?utm_term=.aa961e129167\" target=\"_blank\">(The real number of MS-13 gang members who have been deported is smaller.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 6 </strong>“As a result of this insistence, billions of dollars more have begun to pour into NATO.” <span class=\"short-truth\"><a href=\"http://www.nbcnews.com/politics/donald-trump/fact-check-long-trump-took-credit-nato-spending-was-n780241\" target=\"_blank\">(NATO countries agreed to meet defense spending requirements in 2014.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 17 </strong>“We’ve signed more bills — and I’m talking about through the legislature — than any president, ever.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/07/17/us/politics/trump-laws-bills.html\" target=\"_blank\">(Clinton, Carter, Truman, and F.D.R. had signed more at the same point.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 19 </strong>“Um, the Russian investigation — it’s not an investigation, it’s not on me — you know, they’re looking at a lot of things.” <span class=\"short-truth\"><a href=\"http://time.com/4823514/donald-trump-investigation-jay-sekulow/\" target=\"_blank\">(It is.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 19 </strong>“I heard that Harry Truman was first, and then we beat him. These are approved by Congress. These are not just executive orders.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/07/17/us/politics/trump-laws-bills.html\" target=\"_blank\">(Presidents Clinton, Carter, Truman, and F.D.R. each had signed more legislation than Trump at the same point in their terms.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 19 </strong>“But the F.B.I. person really reports directly to the president of the United States, which is interesting.” <span class=\"short-truth\"><a href=\"https://www.usatoday.com/story/news/politics/onpolitics/2017/07/20/fbi-director-reports-justice-department-not-president/495094001/\" target=\"_blank\">(He reports directly to the attorney general.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 19 </strong>“She did the uranium deal, which is a horrible thing, while she was secretary of state, and got a lot of money.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/10/facts-uranium-one/\" target=\"_blank\">(There's no evidence Hillary Clinton was actively involved or benefited from the deal.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 24 </strong>“It looks like about 45,000 people. You set a record today.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/07/26/26-hours-29-trumpian-false-or-misleading-claims/?utm_term=.2e4b2407199f\" target=\"_blank\">(Many fewer than 45,000 were there, and the attendance was not a record.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 25 </strong>“We have the highest taxes anywhere in the world, and this will really bring them down to one of the lowest.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/oct/18/donald-trump/once-again-trump-overstates-us-tax-ranking/\" target=\"_blank\">(Tax rates in the United States are below average, overall and for an industrialized country.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 25 </strong>“We’re the highest-taxed nation in the world” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/oct/18/donald-trump/once-again-trump-overstates-us-tax-ranking/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 25 </strong>“We have nearly doubled the number of veterans given approvals to see the doctor of their choice.” <span class=\"short-truth\"><a href=\"https://www.usatoday.com/story/opinion/2017/07/24/veterans-health-care-will-not-be-privatized-david-shulkin-column/499417001/\" target=\"_blank\">(The increase was 26 percent.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 25 </strong>“Since I took office we have cut illegal immigration on our southern border by record numbers. 78 percent.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/10/12/us/politics/trump-border-claim-factcheck.html?_r=0\" target=\"_blank\">(The decline began before Trump's inauguration.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 28 </strong>“The previous administration enacted an open-door policy to illegal migrants from Central America.  \"Welcome in. Come in, please, please.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/article/2017/jul/28/fact-checking-donald-trumps-ny-speech-law-enforcem/\" target=\"_blank\">(Obama deported millions.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 28 </strong>“We have trade deficits with almost every country because we had a lot of really bad negotiators making deals with other countries.” <span class=\"short-truth\"><a href=\"https://www.bea.gov/newsreleases/international/trade/2017/trad0917.htm\" target=\"_blank\">(The U.S. has a trade surplus with more than 100 countries.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 31 </strong>“2.6 is a number that nobody thought they’d see for a long period of time.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/08/trumps-gdp-puffery/\" target=\"_blank\">(Many experts predicted economic growth at least this high.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>July 31 </strong>“And even the President of Mexico called me  – they said their southern border, very few people are coming because they know they’re not going to get through our border, which is the ultimate compliment.” <span class=\"short-truth\"><a href=\"http://www.cnn.com/2017/08/02/politics/trump-phone-calls/index.html\" target=\"_blank\">(Mexico's president says he didn't call Trump.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 1 </strong>“And I think to me, maybe the biggest is that GDP for the quarter just released at 2.6 percent. So that's so much higher than anticipated.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/08/trumps-gdp-puffery/\" target=\"_blank\">(It wasn't.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 3 </strong>“Economic growth has surged to 2.6% nationwide. You have to understand what that means. Nobody thought that number was going to happen.” <span class=\"short-truth\"><a href=\"https://www.usatoday.com/story/news/politics/2017/08/04/fact-checking-donald-trumps-west-virginia-rally/541318001/\" target=\"_blank\">(Many experts predicted that.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 3 </strong>“The Russia story is a total fabrication.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/08/03/fact-checking-the-trump-russia-investigation/?utm_term=.1404a36076a6\" target=\"_blank\">(It's not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 3 </strong>“Or let them look at the uranium she sold that is now in the hands of very angry Russians.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/08/factchecking-trumps-west-virginia-rally/\" target=\"_blank\">(There's no evidence Hillary Clinton was actively involved in the sale.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 15 </strong>“We want products made in the country. Now, I have to tell you, some of the folks that will leave, they're leaving out of embarrassment because they make their products outside.” <span class=\"short-truth\"><a href=\"http://money.cnn.com/2017/08/16/news/trump-manufacturing-council-ceos/index.html\" target=\"_blank\">(People resigned from Trump's business councils over his Charlottesville comments.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 22 </strong>“Remember, everybody said you won’t bring it up to 1 percent. You won’t bring it up to 1.2 percent.” <span class=\"short-truth\"><a href=\"https://washingtonmonthly.com/2017/08/23/quick-takes-how-many-lies-did-trump-tell-last-night/\" target=\"_blank\">(Many experts predicted economic growth at least this high.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 22 </strong>“I mean truly dishonest people in the media and the fake media, they make up stories. They have no sources in many cases. They say 'a source says'  – there is no such thing.” <span class=\"short-truth\"><a href=\"http://www.factcheck.org/2017/02/factchecking-trumps-cpac-speech/\" target=\"_blank\">(The media does not make up sources.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 22 </strong>“As everybody here remembers, this was the scene of my first rally speech, right?” <span class=\"short-truth\"><a href=\"https://www.realclearpolitics.com/articles/2015/06/18/at_trumps_nh_rally_true_believers_and_big_fans_127030.html\" target=\"_blank\">(Trump's first rally was in New Hampshire)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 22 </strong>“We have become an energy exporter for the first time ever just recently.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/aug/23/donald-trump/donald-trump-wrongly-says-us-net-energy-exporte/\" target=\"_blank\">(The U.S. isn't projected to become a net energy exporter until 2026.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Aug. 22 </strong>“Look back there, the live red lights. They're turning those suckers off fast out there. They're turning those lights off fast. Like CNN.” <span class=\"short-truth\"><a href=\"http://www.cnn.com/2017/08/23/politics/phoenix-rally-things-trump-got-wrong/index.html\" target=\"_blank\">(CNN didn't turn off its cameras.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 6 </strong>“The taxes are crazy  – the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 6 </strong>“We are the highest taxed nation in the world - that will change.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 8 </strong>“Our incredible U.S. Coast Guard saved more than 15,000 lives last week with Harvey.” <span class=\"short-truth\"><a href=\"https://content.govdelivery.com/accounts/USDHSCG/bulletins/1b5ace3\" target=\"_blank\">(The real number is 11,022.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 14 </strong>“Also with the fact that I know in the case of FEMA and the case of Coast Guard, the job you've done in saving people, saving lives.  As an example, in Harvey in Texas, we talked  – over 16,000 lives.” <span class=\"short-truth\"><a href=\"https://content.govdelivery.com/accounts/USDHSCG/bulletins/1b5ace3\" target=\"_blank\">(The real number is smaller.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 14 </strong>“And in Florida you got hit with the strongest winds ever recorded.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/post-nation/wp/2017/09/09/destructive-winds-rain-hit-florida-as-hurricane-irma-approaches/\" target=\"_blank\">(They weren't the strongest ever recorded.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 22 </strong>“We've been dealing with ICE, we've been dealing with the Border Patrol. They both endorsed me.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/oct/10/donald-trump/trump-says-ice-endorsed-him/\" target=\"_blank\">(Neither agency endorsed him; only their unions did.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 22 </strong>“So he started off here, he was in third or fourth, he went to third, second, and now it's like almost pretty even.” <span class=\"short-truth\"><a href=\"https://www.realclearpolitics.com/epolls/2017/senate/al/alabama_senate_special_election_republican_primary-6220.html#polls\" target=\"_blank\">(Strange consistently polled first or second in the Alabama Republican primary.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 29 </strong>“With the F-35 fighter plane  – me, myself  – I've saved hundreds of millions of dollars in negotiating.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/?utm_term=.ef182851faef\" target=\"_blank\">(The cost cuts were planned before he became president.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 27 </strong>“I’m doing the right thing, and it’s not good for me.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/09/28/fact-checking-president-trumps-tax-speech-in-indianapolis/?utm_term=.1c2a17457496\" target=\"_blank\">(All available evidence suggests he would benefit.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 27 </strong>“To protect millions of small businesses and the American farmer, we are finally ending the crushing, the horrible, the unfair estate tax.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/sep/28/donald-trump/donald-trumps-pants-fire-claim-about-estate-tax-sm/\" target=\"_blank\">(The real number of small businesses and farmers is vastly smaller.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 27 </strong>“No, I don't benefit. I don't benefit. In fact, very very strongly, as you see, I think there's very little benefit for people of wealth.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/sep/28/donald-trump/donald-trumps-dubious-claim-his-tax-plan-wont-bene/\" target=\"_blank\">(The tax plan would personally benefit Trump and other wealthy individuals.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 27 </strong>“Facebook was always anti-Trump.The Networks were always anti-Trump hence,Fake News, @nytimes(apologized) &amp; @WaPo were anti-Trump.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2016/11/13/us/elections/to-our-readers-from-the-publisher-and-executive-editor.html\" target=\"_blank\">(The Times did not apologize for its Trump coverage.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Sept. 28 </strong>“I mean right now, we're the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 3 </strong>“But the Coast Guard itself saved in Texas 16,000 lives, and they went right through that hurricane.” <span class=\"short-truth\"><a href=\"https://content.govdelivery.com/accounts/USDHSCG/bulletins/1b5ace3\" target=\"_blank\">(The real number is smaller.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 3 </strong>“But that's an expensive plane that you can't see. And as you probably heard, we cut the price very substantially  – something that other administrations would never have done, that I can tell you.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/?utm_term=.ef182851faef\" target=\"_blank\">(The cost cuts were planned before he became president.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 6 </strong>“I was able to reduce the price of the Lockheed by billions of dollars.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/01/31/trumps-claim-taking-credit-for-cutting-600-million-from-the-f-35-program/?utm_term=.ef182851faef\" target=\"_blank\">(The cost cuts were planned before he became president.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 6 </strong>“We're the highest-taxed developed nation in the world, probably the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 6 </strong>“They also just said that there has been absolutely no collusion. They just said that. Yesterday. Two days ago. Senate. There has been no collusion.” <span class=\"short-truth\"><a href=\"http://www.cnn.com/TRANSCRIPTS/1710/04/ip.02.html\" target=\"_blank\">(The Senate didn't say that.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 6 </strong>“This tax cut and tax reform is going very well, and it's going to be a tremendous boost for our country, including the fact that we're the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 7 </strong>“We're the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 7 </strong>“The Coast Guard, in Texas, and all over, but with the job they did in Texas, I saw, they saved 16,000 lives.” <span class=\"short-truth\"><a href=\"https://content.govdelivery.com/accounts/USDHSCG/bulletins/1b5ace3\" target=\"_blank\">(The real number is smaller.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 7 </strong>“Obama should have never gotten out the way he got out. That's how ISIS formed.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2015/11/19/world/middleeast/in-rise-of-isis-no-single-missed-key-but-many-strands-of-blame.html\" target=\"_blank\">(The group’s origins date to 2004.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 10 </strong>“The Failing @nytimes set Liddle' Bob Corker up by recording his conversation. Was made to sound a fool, and that's what I am dealing with!” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/10/10/reader-center/trump-claims-we-tricked-bob-corker-heres-the-truth.html?_r=0\" target=\"_blank\">(Corker asked the Times reporter to record the call; his aides recorded it too.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 10 </strong>“We're the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 11 </strong>“We have missiles that can knock out a missile in the air. Ninety seven per cent of the time. If you send two of them, it's going to get knocked out.” <span class=\"short-truth\"><a href=\"https://warontherocks.com/2017/10/deadly-overconfidence-trump-thinks-missile-defenses-work-against-north-korea-and-that-should-scare-you/\" target=\"_blank\">(The effectiveness rate is about 60 percent.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 16 </strong>“We're the highest-taxed country in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 16 </strong>“I hear that Ireland is going to be reducing their corporate rates down to 8 percent from 12.” <span class=\"short-truth\"><a href=\"https://www.snopes.com/trump-ireland-tax/\" target=\"_blank\">(Ireland has no plans to cut its tax rate.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 16 </strong>“If you look at President Obama and other presidents, most of them didn’t make calls.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2017/10/16/us/politics/trump-obama-killed-soldiers.html\" target=\"_blank\">(They did call families of soldiers killed in action.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 16 </strong>“All I can say is it's totally fake news, just fake. It's fake. It's made-up stuff, and it's disgraceful what happens, but that happens in the world of politics.” <span class=\"short-truth\"><a href=\"https://www.washingtonpost.com/news/fact-checker/wp/2017/10/27/trump-says-sex-harassment-claims-are-fake-news-but-there-are-corroborators/?utm_term=.23c3b28384e2\" target=\"_blank\">(Trump himself has bragged about groping women.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 17 </strong>“We're the highest taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 17 </strong>“Right now, we are the highest-taxed nation anywhere in the world. You can even say developed or undeveloped.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 17 </strong>“As far as I'm concerned, I think we're really essentially the highest. But if you'd like to add the developed nation, you can say that, too.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(Taxes in the U.S. are lower than in most developed countries.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 17 </strong>“We're the highest-taxed nation in the world. We are taxed beyond belief.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 17 </strong>“Well, we're the highest-taxed nation in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 17 </strong>“I wish President Obama didn't get out the way he got out. Because that left a vacuum and ISIS was formed.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/2015/11/19/world/middleeast/in-rise-of-isis-no-single-missed-key-but-many-strands-of-blame.html\" target=\"_blank\">(The group’s origins date to 2004.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 18 </strong>“Democrat Congresswoman totally fabricated what I said to the wife of a soldier who died in action (and I have proof).” <span class=\"short-truth\"><a href=\"http://time.com/4993045/myeshia-johnson-donald-trump-frederica-wilson/\" target=\"_blank\">(The wife confirmed Representative Frederica Wilson's account.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 18 </strong>“The Coast Guard in Texas saved 16,000 lives.” <span class=\"short-truth\"><a href=\"https://content.govdelivery.com/accounts/USDHSCG/bulletins/1b5ace3\" target=\"_blank\">(The real number was smaller.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 18 </strong>“Nobody has ever heard of a five hitting land.” <span class=\"short-truth\"><a href=\"http://www.cnn.com/2017/09/07/us/three-category-5-hurricanes-landfall-trnd/index.html\" target=\"_blank\">(Category 5 storms have hit land before.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 24 </strong>“Under our plan, more than 30 million Americans who own small businesses will get a 40 per cent cut to their top marginal tax rate.” <span class=\"short-truth\"><a href=\"http://www.businessinsider.com/trump-small-business-tax-cut-pass-through-s-corporations-2017-10\" target=\"_blank\">(The real number is estimated to be less than 1 million.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 25 </strong>“We have trade deficits with almost everybody.” <span class=\"short-truth\"><a href=\"https://www.bea.gov/newsreleases/international/trade/2017/trad0917.htm\" target=\"_blank\">(We have trade surpluses with more than 100 countries.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Oct. 27 </strong>“Wacky &amp; totally unhinged Tom Steyer, who has been fighting me and my Make America Great Again agenda from beginning, never wins elections!” <span class=\"short-truth\"><a href=\"https://www.opensecrets.org/donor-lookup/results?name=Thomas+Steyer\" target=\"_blank\">(Steyer has financially supported many winning candidates.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Nov. 1 </strong>“Again, we're the highest-taxed nation, just about, in the world.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2016/may/08/donald-trump/donald-trump-us-not-highest-taxed-nation-in-world/\" target=\"_blank\">(We're not.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Nov. 7 </strong>“When you look at the city with the strongest gun laws in our nation, it's Chicago.” <span class=\"short-truth\"><a href=\"http://www.politifact.com/truth-o-meter/statements/2017/nov/07/donald-trump/trump-wrongly-repeats-chicago-has-strongest-gun-la/\" target=\"_blank\">(Several other cities, including New York and Los Angeles, have stronger gun laws.)</a></span></span>,\n",
       " <span class=\"short-desc\"><strong>Nov. 11 </strong>“I'd rather have him  – you know, work with him on the Ukraine than standing and arguing about whether or not  – because that whole thing was set up by the Democrats.” <span class=\"short-truth\"><a href=\"https://www.nytimes.com/interactive/2017/12/10/us/politics/trump-and-russia.html\" target=\"_blank\">(There is no evidence that Democrats \"set up\" Russian interference in the election.)</a></span></span>]"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 通过名字和属性搜不同的标签内容\n",
    "# results = soup.find_all('span', attrs = {'class': 'short-desc'})\n",
    "# results\n",
    "# 短写法：如果你不指定方法，程序将默认是 `find_all`\n",
    "# results = soup('span', attrs={'class':'short-desc'})\n",
    "# results\n",
    "# 更短的写法：你可以指定属性作为一个参数\n",
    "results = soup('span', class_='short-desc')\n",
    "results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
